// Client

AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")

// Include

include('shared.lua')

// Initialize

function ENT:Initialize()
	self.Entity:PhysicsInit(SOLID_VPHYSICS)
	self.Entity:SetMoveType(MOVETYPE_VPHYSICS)
	self.Entity:SetSolid(SOLID_VPHYSICS)
	self.Entity:SetUseType(ONOFF_USE)
	self.Entity:SetNetworkedInt(0, 0)
end

// Use

function ENT:Use(Activator, Caller)
	if not (Activator:KeyDown(IN_USE)) then
		if (self.Entity:GetNetworkedInt("Playing") == 0) then
			self:PlayEntitySong()
		else
			self:StopEntitySong()
		end
	end
end

// Think

function ENT:Think()
	self:SetEntityLabel(self.Entity.Description)
	
	self.Entity:NextThink(CurTime() + 1)
end

// Remove

function ENT:OnRemove()
	self:StopEntitySong()
end